<script language="javascript">
<!--
function f_impInmaterial() {
	var contract_id = window.parent.document.all("finance_onroad_pay.contract_id").value;

	//alert("contract_id = " + contract_id);

	//return false;

	var funcid = "GROUPAUDIT_PROVIDER";
	var contextPath = document.all("contextPath").value;
	var href = contextPath + "/layout/commonwin.jsp?funcid=" + funcid;
	href += "&where_sql=in_material.contract_id = ?";
	href += "&where_value=" + contract_id;
	href += "&where_type=string";
	href += "&pageType=impInMaterial";

	gc_util.openModelWindow(href ,true ,700 ,400);
	f_reloadPage();
}

function f_groupAccount() {
	if (!trselObj.f_isSelectRow()) return ;
	//alert("hello");
	var parentWin = window.top.dialogArguments;
	var parentWins = window.top.dialogArguments.parent;

	//alert(parentWin.location);

	var invoice_id = parentWin.trselObj.f_get_select_key()[0];
	var finance_provider_code = parentWin.trselObj.f_getTDValueByKeyName(invoice_id ,"finance_invoice_onroad.finance_provider_code");
	var contract_id = parentWins.document.all("finance_onroad_pay.contract_id").value;

	//alert("finance_provider_code = " + finance_provider_code);
	//alert("invoice_id = " + invoice_id);

	if (!trselObj.f_isSelectRow()) return ;

	//var onroad_id = window.top.dialogArguments.parent.document.all("finance_onroad_pay.onroad_id").value;
	//alert("onroad_id = " + onroad_id);

	var frmObj = document.forms(formName);
	var action = document.forms(formName).action.split("?")[0];
	action += "?finance_provider_code=" + finance_provider_code;
	action += "&invoice_id=" + invoice_id;
	action += "&contract_id=" + contract_id;

	document.forms(formName).action = action;
	frmObj.ActionType.value = "groupAccount";
	frmObj.target = "frmhidden";

	frmObj.submit();
	document.all("groupAccount").disabled = true;
}
//-->
</script>